< previous page page_56 next page >

Page 56
TABLE 2.1.CONTINUED
ControlNameCaption
Command ButtoncmdMoveMove
Command ButtoncmdCopyCopy
Command ButtoncmdTargetFileBrowse
Command ButtoncmdSourceFileBrowse
LabellblSourceFileSource File:
LabellblTargetFileDestination File:

Listing 2.2 shows the final code. Copy it into the frmDialog form's code window; then try running the application and then copying or moving a file.
LISTING 2.2. FILEOPENCOPY.BASCOMMAND-BUTTON PROCESSING ROUTINES.

8694cbadb9b1ef7075903f6f95fc1db2.gif
 1: Private Sub cmdClose_Click()
 2:     End
 3: End Sub
 4:
 5: Private Sub cmdCopy_Click()
 6:     Call FileProcess (ActionCopy)
 7: End Sub
 8:
 9: Private Sub cmdMove_Click()
10:     Call FileProcess (ActionMove)
11: End Sub
12:
13: Private Sub cmdSourceFile_Click()
14:     dlgFileSelect.Flags = cdlOFNFileMustExist
15:     dlgFileSelect.ShowOpen
16:     txtSourceFile.Text = dlgFileSelect.filename
17:
18: End Sub
19:
20: Private Sub cmdTargetFile_Click()
21:     dlgFileSelect.Flags = cdlOFNOverwritePrompt
22:     dlgFileSelect.ShowSave
23:     txtTargetFile.Text = dlgFileSelect.filename
24: End Sub
25:
26: Private Sub Form_Load()
27:     Load frmStatus
28: End Sub

 
< previous page page_56 next page >

If you like this book, buy it!